
class Store(object):

	def slect_car(self):
		pass

	def order(self,name):
		return self.select_car(name)


class BMWCarStore(Store):
	def slect_car(self,name):
		return BMWFactory().select_car_by_name(name)


class CarStore(Store):

	def slect_car(self,name):
		return Factory().select_car_by_name(name)


class BMWFactory(object):

	def select_car_by_name(name):
		pass


# 通过函数来进行解耦
class Factory(object):

	def select_car_by_name(name):
		if name == "索纳塔":
			return Suonata()
		elif name == "特斯拉":
			return Tesla()
		elif name == "FF91"
			return LeCar()
   
		
class Car(object):

	def move(self):
		print('移动')

	def music(self):
		print('音乐')

	def stop(self):
		print('停止')


class Suonata(Car):
	pass

class Tesla(Car):
	pass

class LeCar(Car):
	pass

car_store = CarStore()
car = car_store.order("特斯拉")

bmw_store = BMWCarStore()
bmw_store.order("迷你")

car.move()
car.music()
car.stop()
